#include <memory>
#include <string>
#include <iostream>
#include "searcher.hpp"

const std::string input = "data/raw_htmls/raw.bin";

int main()
{
    std::unique_ptr<ns_searcher::Searcher> searcher(new ns_searcher::Searcher());
    searcher->InitSearcher(input);
    std::string query;
    while(true)
    {
        std::cout << "Please Input Your Query@ ";
        std::getline(std::cin, query);
        std::string out;
        searcher->Search(query, &out);
        std::cout << out << std::endl;
    }
    //for debug
    // std::string query;
    // while(true)
    // {
    //     std::cout << "Please Input Your Query@ ";
    //     std::getline(std::cin, query);
    //     std::vector<std::string> out;
    //     ns_util::JiebaUtil::CutString(query, &out);
    //     std::cout << "分词结果:" << std::endl;
    //     for(const auto& word : out) {
    //         std::cout << word << "/";
    //     }
    //     std::cout << std::endl;
    // }
    return 0;
}